package com.itheima.d1_method;

import java.util.Random;

public class Test27 {
    public static void main(String[] args) {
        int[] nums = test();
        for (int i = 0; i < nums.length; i++) {
            System.out.println(nums[i]);
        }


    }

    public static int[] test() {
        int[] a = new int[10];
        Random random = new Random();
        for (int i = 0; i < a.length; i++) {
            a[i] = random.nextInt(10) + 1;
            for (int j = 0; j < i; j++) {
                if (a[i] == a[j]) {
                    i--;
                    break;
                }
            }
        }
        return a;

    }

}

